import mongoose from 'mongoose';

export default defineNitroPlugin((): void => {
	mongoose
		.connect('mongodb://localhost:27017/ly-blog-simple')
		.then((): void => {
			console.log('Connected to MongoDB !');
		})
		.catch((err: Error): void => {
			console.log('Error connecting to MongoDB !');
			console.error(err);
		});
});
